/**
 * @file /include/kinova_driver_qt/kinovaStatus.hpp
 *
 * @brief receive status xml and parse it!
 *
 * @date May 2012
 **/


#ifndef kinova_driver_qt_KINOVA_STATUS_H
#define kinova_driver_qt_KINOVA_STATUS_H

/*****************************************************************************
** Includes
*****************************************************************************/

#include <string>
#include <QThread>
#include <QStringListModel>
#include <QUdpSocket>
#include "basicUtils.hpp"
#include <QXmlStreamReader>

/*****************************************************************************
** Namespaces
*****************************************************************************/

namespace kinova_driver_qt {

class kinovaStatusHandler : public QObject
{
    Q_OBJECT
public:
        kinovaStatusHandler( );
        Status       parseStatus( QByteArray byteArray );

        ~kinovaStatusHandler();

private:

        Cartesian                   parseCposition(QXmlStreamReader& xml);
        geometry_msgs::Point32      parsePosition (QXmlStreamReader &xml);
        geometry_msgs::Point32      parseRotation (QXmlStreamReader &xml);
        Joints                      parseJoints   (QXmlStreamReader &xml);
        Fingers                     parseFingers  (QXmlStreamReader &xml);

        QString                 getAddElementData(QXmlStreamReader& xml);

    };

}  // namespace kinova_driver_qt

#endif
